import 'package:boss/color_constant.dart';
import 'package:boss/provider/store_message_provider.dart';
import 'package:boss/textStyle/text_style.dart';
import 'package:boss/ui/widget/avatar.dart';
import 'package:hi_common/hi_common.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class PersonalSettingUserCard extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.only(top: 60.w + MediaQuery.of(context).padding.top, left: 20.w, right: 80.w),
      child: Consumer<StoreMessageProvider>(
        builder: (context, storeMessageProvider, _) {
          return Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: <Widget>[
              Expanded(
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: <Widget>[
                    Text(
                      '${storeMessageProvider.storeMessage?.storeName ?? '正在加载'}',
                      style: TextStyle(fontSize: 50.sp, color: ColorConstant.ff33, fontWeight: FontWeight.w500),
                    ),
                    Container(
                      margin: EdgeInsets.only(top: 40.w, bottom: 10.w),
                      child: Text(
                        '商户编号：${storeMessageProvider.storeMessage?.storeNo ?? '正在加载'}',
                        style: TextStyleConstant().normal_1_32,
                      ),
                    ),
                    Text(
                      '${storeMessageProvider.storeAddress}',
                      style: TextStyleConstant().normal_1_32,
                      overflow: TextOverflow.ellipsis,
                      maxLines: 1,
                    ),
                  ],
                ),
              ),
              Avatar(
                image: storeMessageProvider.storeMessage?.storeHeadImage,
                size: 140.w,
              ),
            ],
          );
        },
      ),
    );
  }
}
